Button Customization

Override the Save Button Handler to Modify and Redirect URL Values

Code Customization
Override the Save Button Handler to Modify and Redirect URL Values
Description:

Primary keys, foreign keys, and other field values are easily passed from page to page via URL parameters established with settings in the Bindings tab of the Properties dialog. Sometimes, however, you may need to pass non-databound values and other calculated values via URL parameters. This can be done by overriding the Save button click handler method on the record page.

This example shows how to redirect to some other page after updating or creating new record in a page. the user is redirected to some other page instead of the normal (default) behavior of going back to the previous page. To do this, we override the SaveButton_Click() button click event handler method in the Page class in aspx.cs code-behind file.

For a Web Application the customization will be added in:

..\<Application Name>\<Table Name>\Add<Table Name>.Controls.cs

For example: C:\MyApp1\Orders\AddOrders.Controls.cs


For a Web Site the customization will be added in:

..\<Application Name>\App_Code\<Table Name>\Add<Table Name>.Controls.cs

For example: C:\MyApp1\App_Code\Orders\AddOrders.Controls.cs

This customization will be executed when the "Save" button, which updates a record, is clicked, so this customization can also be done on the edit page.

Procedure:

Step 1:  Use this wizard to add the code customization.

Step 2:  Remove the initial call to SaveButton_Click_Base(sender, args) at the top of the code customization sample.

Step 3:  Build and run the application.

Applies To:

This code customization is applicable only for editable record pages.

Note:

This customization will get added in the Page class.

Disclaimer:
Customizations included in this wizard are provided as a sample to demonstrate a feature, and may work only in specific situations. The Iron Speed Designer support team cannot assist in the resolution of problems which may occur as a result of customizing your application or modifying a customization to fit a particular purpose.

Terms of Service Privacy Statement